﻿var order;
function onSorting(s, e) {
    order = order == "ASC" ? "DESC" : "ASC";
    e.cancel = true;
    s.PerformCallback("SORT|" + e.column.fieldName + "|" + order);
}

function getTest() {
    gridViewHistoryClient.PerformCallback("PAGING");
}

function getIndex(s, e) {
    //alert('GetIndex ...');
    if (typeof (gridViewHistoryClient) != 'undefined' && e.visibleIndex != -1) {
        //alert('First Callback ...');
        Callback1.PerformCallback("INDEX|" + e.visibleIndex);
        //alert('Second Callback ...');
        gridViewHistoryClient.PerformCallback("INDEX|" + e.visibleIndex);
    }
}

function checkChanged(s, e) {
    //alert('CheckChanged ...');
    var isVisible = s.GetChecked();
    var i = gridViewHistoryClient.visibleIndex;
    //if (typeof (gridViewHistoryClient) != 'undefined' && e.visibleIndex != -1) {
    Callback1.PerformCallback("REMARK|" + isVisible + "|" + i);
    //}
}

function RefreshData(s, e) {
    //alert('RefreshData ...');
    var isIncrease = false;
    if (isIncrease.Checked)
        isIncrease = true;

    var numDays = cboNumDaysClient.GetValue();
    if (typeof (gridViewHistoryClient) != 'undefined')
        gridViewHistoryClient.PerformCallback("REFRESH|" + isIncrease + "|" + numDays);
}

function OnCallbackComplete(s, e) {
    //alert('OnCallbackComplete ...');
    lblInfoClient.SetText(e.result);
    //lblNewsClient.SetText(e.result);
}

function getPaging(s, e) {
    //alert('GetPaging ...');
    if (typeof (gridViewHistoryClient) != 'undefined' && e.visibleIndex != -1) {
        gridViewHistoryClient.PerformCallback("PAGING");
        Callback1.PerformCallback(e.visibleIndex);
    }
}